#include "../headers/bezier.h"

Point3d Bezier::drawBezier (Bezier B,float t)
{
	Point3d ponto1;
	Point3d ponto2;
	ponto1= B.A;
	delta=0.01;

	//for(float t=0; t<=1; t+=delta)
	//{
		ponto2 = B.A *(1 - t)*(1 - t)*(1 - t) +
				 B.B * 3 * t * (1 - t)*(1 - t) +
				 B.C * 3 * t * t * (1 - t)  +
				 B.D * t * t * t ;
		
/*		
		  glPushMatrix();
	
		  glTranslatef(ponto2.xx,ponto2.yy,ponto2.zz);
		  glutSolidSphere(2,10,10);
	  
		  glBegin(GL_LINE_STRIP);
		  glPointSize(30);
		  glVertex3f(ponto1.xx,ponto1.yy,ponto1.zz);
		  glVertex3f(ponto2.xx,ponto2.yy,ponto2.zz);
		  glEnd();

		    
		  glPopMatrix();
*/		
		ponto1 = ponto2;

		return ponto2;
	//}
}